import request from '@/request'
const URL = process.env.VUE_APP_API

// 获取用户列表
export function getUserList(data) {
  return request({
    url: `${URL}/manage/upms/user/search`,
    method: 'post',
    data
  })
}
// 用户新增接口
export function addUser(data) {
  return request({
    url: `${URL}/manage/upms/user/add`,
    method: 'post',
    data
  })
}
// 删除数据
export function deleteUser(id) {
  return request({
    url: `${URL}/manage/upms/user/delete?id=${id}`,
    method: 'post'
  })
}
// 编辑用户接口
export function updateUser(data) {
  return request({
    url: `${URL}/manage/upms/user/update`,
    method: 'post',
    data
  })
}
// 禁用用户接口
export function lockUser(id) {
  return request({
    url: `${URL}/manage/upms/user/lock?id=${id}`,
    method: 'post'
  })
}
// 启用用户接口
export function unlockUser(id) {
  return request({
    url: `${URL}/manage/upms/user/unlock?id=${id}`,
    method: 'post'
  })
}
// 用户详情接口
export function getUserDetail(params) {
  return request({
    url: `${URL}/manage/upms/user/detail`,
    method: 'get',
    params
  })
}
// 获取用户功能权限接口
export function getUserPermissions(params) {
  return request({
    url: `${URL}/manage/upms/user/permissions`,
    method: 'get',
    params
  })
}
